﻿using Aliyun.Acs.Core;
using Aliyun.Acs.Core.Profile;
using System;
using System.Collections.Generic;
using System.Text;

namespace aliyun_net_sdk_core_extension.Client
{
    public class AcsClientService : IAcsClientService
    {
        public AcsConfig AcsConfig { get; }

        public AcsClientService(AcsConfig acsConfig)
        {
            AcsConfig = acsConfig ?? throw new ArgumentNullException(nameof(acsConfig));
        }

        public DefaultAcsClient GetClient()
        {
            IClientProfile profile = DefaultProfile.GetProfile(AcsConfig.RegionId, AcsConfig.AppKey, AcsConfig.AppSecret);
            DefaultAcsClient client = new DefaultAcsClient(profile);
            return client;
        }
    }
}
